package com.example.mapper;

import com.example.entity.Tables;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface TablesMapper {


    void insert(Tables tables);

    void deleteById(Integer id);

    void updateById(Tables tables);
    @Select("SELECT * FROM tables WHERE user_id = #{userId}")
    Tables  selectByUserId (Integer  userId);
    @Select("SELECT * FROM tables WHERE id = #{id}")
    Tables selectById(Integer id);

    List<Tables> selectAll(String name);
    @Select("update tables set user_id = null, free ='是' where id = #{id}")
    void removeOrder(Integer id);


//    @Select("SELECT * FROM tables WHERE user_id = #{userId}")
//    Tables selectByUserId(Integer userId);


}
